package com.coolgor.axnut.dto.auth;

import java.util.List;

import com.coolgor.airvow.Util.DataTree;
import com.coolgor.axnut.entity.auth.Function;
import com.coolgor.axnut.enums.auth.FunctionStateEnum;

public class FunctionExecution {
	// 结果状态
	private int state;

	// 状态标识
	private String stateInfo;

	// 执行结果的数量
	private int count;

	// 操作的对象(增删改的时候用到)
	private Function function;

	// 获取的结果列表(查询列表的时候使用)
	private List<Function> functionList;	
	
	// 获取的树形结果(查询列表的时候使用)
	private DataTree functionTree;

	public FunctionExecution() {	}

	// 操作失败的时候使用的构造器
	public FunctionExecution(FunctionStateEnum stateEnum) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
	}

	// 增删改 操作成功的时候使用的构造器
	public FunctionExecution(FunctionStateEnum stateEnum, Function function) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
		this.function = function;
	}

	// 查询 操作成功的时候使用的构造器
	public FunctionExecution(FunctionStateEnum stateEnum, List<Function> functionList) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
		this.functionList = functionList;
	}
	
	// 查询 操作成功的时候使用的构造器
	public FunctionExecution(FunctionStateEnum stateEnum, DataTree functionTree) {
		this.state = stateEnum.getState();
		this.stateInfo = stateEnum.getStateInfo();
		this.functionTree = functionTree;
	}
	
	

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public String getStateInfo() {
		return stateInfo;
	}

	public void setStateInfo(String stateInfo) {
		this.stateInfo = stateInfo;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public Function getFunction() {
		return function;
	}

	public void setFunction(Function function) {
		this.function = function;
	}

	public List<Function> getFunctionList() {
		return functionList;
	}

	public void setFunctionList(List<Function> functionList) {
		this.functionList = functionList;
	}

	public DataTree getFunctionTree() {
		return functionTree;
	}

	public void setFunctionTree(DataTree functionTree) {
		this.functionTree = functionTree;
	}
}
